From a06611755a83d518eca4321cdd3474c6bc28f472 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Tue, 2 Apr 2013 12:05:50 +0200 Subject: [PATCH] API param validation: Set strict mode for in_array The in_array gives true when the allowed values contains a 0 as value, for example by namespaces, action=query&list=allpages&apnamespace=test|tset was not rejected Change-Id: I9220a955ffaf2bcb0d1d5b27c948af2f85714110 --- includes/api/ApiBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 741e908351..84a6ed95d4 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -1081,7 +1081,7 @@ abstract class ApiBase extends ContextSource { if ( !$allowMultiple && count( $valuesList ) != 1 ) { // Bug 33482 - Allow entries with | in them for non-multiple values - if ( in_array( $value, $allowedValues ) ) { + if ( in_array( $value, $allowedValues, true ) ) { return $value; } -- 2.20.1